package com.itheima.test2;

import java.io.*;
import java.util.Scanner;

/*
将键盘录入的用户名和密码保存到本地实现永久化存储
 */
public class Test05 {

    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入用户名");
        String username = sc.nextLine();
        System.out.println("请输入密码");
        String password = sc.nextLine();

        FileOutputStream fos = new FileOutputStream("day13\\user.txt");
        fos.write((username+"="+password).getBytes());

        fos.close();
        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("day13\\user2.txt"));
        bos.write((username+"="+password).getBytes());
       bos.close();

        FileWriter writer = new FileWriter("day13\\user3.txt");
        writer.write(username+"="+password);
        writer.close();
        BufferedWriter bw = new BufferedWriter(new FileWriter("day13\\user4.txt"));
        bw.write(username+"="+password);
        bw.close();


    }

}
